﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Overwrite Files | DocFX website </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Overwrite Files | DocFX website ">
    <meta name="generator" content="docfx 2.37.0.0">
    
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    
    <meta property="docfx:rel" content="../">
    
  </head>
  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../index.html">
                <img id="logo" class="svg" src="../logo.svg" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div class="container body-content">
        
        <div id="search-results">
          <div class="search-list"></div>
          <div class="sr-items">
            <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
          </div>
          <ul id="pagination"></ul>
        </div>
      </div>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="">
<h1 id="overwrite-files">Overwrite Files</h1>

<h2 id="introduction">Introduction</h2>
<p>DocFX supports processing Markdown files, as well as structured data model in YAML or JSON format.</p>
<p>We call Markdown files <em>Conceptual File</em>s, and the structured data model files <em>Metadata File</em>s.</p>
<p>Current supported <em>Metadata File</em>s include:</p>
<ol>
<li>YAML files presenting managed reference model following <a href="../spec/metadata_dotnet_spec.html">Metadata Format for .NET Languages</a>.</li>
<li>Swagger JSON files presenting Swagger REST API model following <a href="http://swagger.io/specification">Swagger Specification Version 2.0</a>.</li>
</ol>
<p>Inside DocFX, both <em>Conceptual File</em>s and <em>Metadata File</em>s are represented as <em>Model</em>s with different properties. Details on <em>Model</em> structure for these files are described in <a href="#data-model-inside-docfx">Data model inside DocFX</a> section.</p>
<p>DocFX introduces the concept of <em>Overwrite File</em> to modify or add properties to <em>Model</em>s without changing the input <em>Conceptual File</em>s and <em>Metadata File</em>s.</p>
<h2 id="the-format-of-overwrite-files">The format of <em>Overwrite File</em>s</h2>
<p><em>Overwrite File</em>s are Markdown files with multiple <em>Overwrite Section</em>s starting with YAML header block. A valid YAML header for an <em>Overwrite Section</em> <em>MUST</em> take the form of valid <a href="http://www.yaml.org/spec/1.2/spec.html">YAML</a> set between triple-dashed lines and start with property <code>uid</code>. Here is a basic example of an <em>Overwrite Section</em>:</p>
<pre><code class="lang-md">---
uid: microsoft.com/docfx/Contacts
some_property: value
---
Further description for `microsoft.com/docfx/Contacts`
</code></pre>
<p>Each <em>Overwrite Section</em> is transformed to <em>Overwrite Model</em> inside DocFX. For the above example, the <em>Overwrite Model</em> represented in YAML format is:</p>
<pre><code class="lang-yaml">uid: microsoft.com/docfx/Contacts
some_property: value
conceptual: &lt;p&gt;&lt;b&gt;Content&lt;/b&gt; in Markdown&lt;/p&gt;
</code></pre>
<h3 id="anchor-content">Anchor <code>*content</code></h3>
<p><code>*content</code> is the keyword invented and used specifically in <em>Overwrite File</em>s to represent the Markdown content following YAML header. We leverage <a href="http://www.yaml.org/spec/1.2/spec.html#id2765878">Anchors</a> syntax in YAML specification for <code>*content</code>.</p>
<p>The value for <code>*content</code> is always transformed from Markdown content to HTML. When <code>*content</code> is not used, the Markdown content below YAML header will be set to <code>conceptual</code> property; When <code>*content</code> is used, the Markdown content below YAML header will no longer be set to <code>conceptual</code> property. With <code>*content</code>, we can easily add Markdown content to any properties.</p>
<pre><code class="lang-md">---
uid: microsoft.com/docfx/Contacts
footer: *content
---
Footer for `microsoft.com/docfx/Contacts`
</code></pre>
<p>In the above example, the value for <code>*content</code> is <code>&lt;p&gt;Footer for &lt;code&gt;microsoft.com/docfx/Contacts&lt;/code&gt;&lt;/p&gt;</code>, and the <em>Overwrite Model</em> represented in YAML format is:</p>
<pre><code class="lang-yaml">uid: microsoft.com/docfx/Contacts
footer: &lt;p&gt;Footer for &lt;code&gt;microsoft.com/docfx/Contacts&lt;/code&gt;&lt;/p&gt;
</code></pre>
<p><code>uid</code> for an <em>Overwrite Model</em> stands for the Unique IDentifier of the <em>Model</em> it will overwrite. So it is allowed to have multiple <em>Overwrite Section</em>s with YAML Header containing the same <code>uid</code>. For one <em>Overwrite File</em>, the latter <em>Overwrite Section</em> overwrites the former one with the same <code>uid</code>. For different <em>Overwrite File</em>s, the order of overwrite is <strong>Undetermined</strong>. So it is suggested to have <em>Overwrite Sections</em> with the same <code>uid</code> in the same <em>Overwrite File</em>.</p>
<p>When processing <em>Conceptual File</em>s and <em>Metadata File</em>s, <em>Overwrite Model</em>s with the same <code>uid</code> are applied to the processed <em>Model</em>s. Different <em>Model</em>s have different overwrite principles, <a href="#overwrite-principles">Overwrite principles</a> section describes the them in detail.</p>
<h2 id="apply-overwrite-files">Apply <em>Overwrite File</em>s</h2>
<p>Inside <code>docfx.json</code>, <a href="docfx.exe_user_manual.html#32-properties-for-build"><code>overwrite</code></a> is used to specify the <em>Overwrite File</em>s.</p>
<h2 id="overwrite-principles">Overwrite principles</h2>
<p>As a general principle, <code>uid</code> is always the key that an <em>Overwrite Model</em> find the <em>Model</em> it is going to overwrite. So a <em>Model</em> with no <code>uid</code> defined will never get overwritten.</p>
<p>Different types of files produce different <em>Model</em>s. The quickest way to get an idea of what the <em>Model</em> looks like is to run:</p>
<pre><code>docfx build --exportRawModel
</code></pre>
<p><code>--exportRawModel</code> exports <em>Model</em> in JSON format with <code>.raw.json</code> extension.</p>
<p>The basic principle of <em>Overwrite Model</em> is:</p>
<ol>
<li>It keeps the same data structure as the <em>Model</em> it is going to overwrite</li>
<li>If the property is defined in <em>Model</em>, please refer <a href="#data-model-inside-docfx">Data model inside DocFX</a> for the specific overwrite behavior for a specific property.</li>
<li>If the property is not defined in <em>Model</em>, it is added to <em>Model</em></li>
</ol>
<h2 id="data-model-inside-docfx">Data model inside DocFX</h2>
<h3 id="managed-reference-model">Managed reference model</h3>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>uid</strong></td>
<td>uid</td>
<td>Merge key.</td>
</tr>
<tr>
<td>assemblies</td>
<td>string[]</td>
<td>Ignore.</td>
</tr>
<tr>
<td>attributes</td>
<td><a href="#attribute">Attribute</a>[]</td>
<td>Ignore.</td>
</tr>
<tr>
<td>children</td>
<td>uid[]</td>
<td>Ignore.</td>
</tr>
<tr>
<td>documentation</td>
<td><a href="#source">Source</a></td>
<td>Merge.</td>
</tr>
<tr>
<td>example</td>
<td>string[]</td>
<td>Replace.</td>
</tr>
<tr>
<td>exceptions</td>
<td><a href="#exception">Exception</a>[]</td>
<td>Merge keyed list.</td>
</tr>
<tr>
<td>fullName</td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>fullName.<lang></lang></td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>id</td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>implements</td>
<td>uid[]</td>
<td>Ignore.</td>
</tr>
<tr>
<td>inheritance</td>
<td>uid[]</td>
<td>Ignore.</td>
</tr>
<tr>
<td>inheritedMembers</td>
<td>uid[]</td>
<td>Ignore.</td>
</tr>
<tr>
<td>isEii</td>
<td>boolean</td>
<td>Replace.</td>
</tr>
<tr>
<td>isExtensionMethod</td>
<td>boolean</td>
<td>Replace.</td>
</tr>
<tr>
<td>langs</td>
<td>string[]</td>
<td>Replace.</td>
</tr>
<tr>
<td>modifiers.<lang></lang></td>
<td>string[]</td>
<td>Ignore.</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>name.<lang></lang></td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>namespace</td>
<td>uid</td>
<td>Replace.</td>
</tr>
<tr>
<td>overridden</td>
<td>uid</td>
<td>Replace.</td>
</tr>
<tr>
<td>parent</td>
<td>uid</td>
<td>Replace.</td>
</tr>
<tr>
<td>platform</td>
<td>string[]</td>
<td>Replace.</td>
</tr>
<tr>
<td><em>remarks</em></td>
<td>markdown</td>
<td>Replace.</td>
</tr>
<tr>
<td>see</td>
<td><a href="#linkinfo">LinkInfo</a>[]</td>
<td>Merge keyed list.</td>
</tr>
<tr>
<td>seealso</td>
<td><a href="#linkinfo">LinkInfo</a>[]</td>
<td>Merge keyed list.</td>
</tr>
<tr>
<td>source</td>
<td><a href="#source">Source</a></td>
<td>Merge.</td>
</tr>
<tr>
<td><em>syntax</em></td>
<td><a href="#syntax">Syntax</a></td>
<td>Merge.</td>
</tr>
<tr>
<td><em>summary</em></td>
<td>markdown</td>
<td>Replace.</td>
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>Replace.</td>
</tr>
</tbody>
</table>
<h4 id="source">Source</h4>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td>base</td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>content</td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>endLine</td>
<td>integer</td>
<td>Replace.</td>
</tr>
<tr>
<td>id</td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>isExternal</td>
<td>boolean</td>
<td>Replace.</td>
</tr>
<tr>
<td>href</td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>path</td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>remote</td>
<td><a href="#gitsource">GitSource</a></td>
<td>Merge.</td>
</tr>
<tr>
<td>startLine</td>
<td>integer</td>
<td>Replace.</td>
</tr>
</tbody>
</table>
<h4 id="gitsource">GitSource</h4>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td>path</td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>branch</td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>repo</td>
<td>url</td>
<td>Replace.</td>
</tr>
<tr>
<td>commit</td>
<td><a href="#commit">Commit</a></td>
<td>Merge.</td>
</tr>
<tr>
<td>key</td>
<td>string</td>
<td>Replace.</td>
</tr>
</tbody>
</table>
<h4 id="commit">Commit</h4>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td>committer</td>
<td><a href="#user">User</a></td>
<td>Replace.</td>
</tr>
<tr>
<td>author</td>
<td><a href="#user">User</a></td>
<td>Replace.</td>
</tr>
<tr>
<td>id</td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>message</td>
<td>string</td>
<td>Replace.</td>
</tr>
</tbody>
</table>
<h4 id="user">User</h4>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>email</td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>date</td>
<td>datetime</td>
<td>Replace.</td>
</tr>
</tbody>
</table>
<h4 id="exception">Exception</h4>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>type</strong></td>
<td>uid</td>
<td>Merge key.</td>
</tr>
<tr>
<td><em>description</em></td>
<td>markdown</td>
<td>Replace.</td>
</tr>
<tr>
<td>commentId</td>
<td>string</td>
<td>Ignore.</td>
</tr>
</tbody>
</table>
<h4 id="linkinfo">LinkInfo</h4>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>linkId</strong></td>
<td>uid or href</td>
<td>Merge key.</td>
</tr>
<tr>
<td><em>altText</em></td>
<td>markdown</td>
<td>Replace.</td>
</tr>
<tr>
<td>commentId</td>
<td>string</td>
<td>Ignore.</td>
</tr>
<tr>
<td>linkType</td>
<td>enum(<code>CRef</code> or <code>HRef</code>)</td>
<td>Ignore.</td>
</tr>
</tbody>
</table>
<h4 id="syntax">Syntax</h4>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td>content</td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>content.<lang></lang></td>
<td>string</td>
<td>Replace.</td>
</tr>
<tr>
<td>parameters</td>
<td><a href="#parameter">Parameter</a>[]</td>
<td>Merge keyed list.</td>
</tr>
<tr>
<td>typeParameters</td>
<td><a href="#parameter">Parameter</a>[]</td>
<td>Merge keyed list.</td>
</tr>
<tr>
<td>return</td>
<td><a href="#parameter">Parameter</a></td>
<td>Merge.</td>
</tr>
</tbody>
</table>
<h4 id="parameter">Parameter</h4>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>id</strong></td>
<td>string</td>
<td>Merge key.</td>
</tr>
<tr>
<td><em>description</em></td>
<td>markdown</td>
<td>Replace.</td>
</tr>
<tr>
<td>attributes</td>
<td><a href="#attribute">Attribute</a>[]</td>
<td>Ignore.</td>
</tr>
<tr>
<td>type</td>
<td>uid</td>
<td>Replace.</td>
</tr>
</tbody>
</table>
<h4 id="attribute">Attribute</h4>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td>arguments</td>
<td><a href="#argument">Argument</a>[]</td>
<td>Ignore.</td>
</tr>
<tr>
<td>ctor</td>
<td>uid</td>
<td>Ignore.</td>
</tr>
<tr>
<td>namedArguments</td>
<td><a href="#namedargument">NamedArgument</a>[]</td>
<td>Ignore.</td>
</tr>
<tr>
<td>type</td>
<td>uid</td>
<td>Ignore.</td>
</tr>
</tbody>
</table>
<h4 id="argument">Argument</h4>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td>type</td>
<td>uid</td>
<td>Ignore.</td>
</tr>
<tr>
<td>value</td>
<td>object</td>
<td>Ignore.</td>
</tr>
</tbody>
</table>
<h4 id="namedargument">NamedArgument</h4>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>string</td>
<td>Ignore.</td>
</tr>
<tr>
<td>type</td>
<td>string</td>
<td>Ignore.</td>
</tr>
<tr>
<td>value</td>
<td>object</td>
<td>Ignore.</td>
</tr>
</tbody>
</table>
<h3 id="rest-api-model">REST API model</h3>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td><em>children</em></td>
<td><a href="#rest-api-item-model">REST API item model</a></td>
<td>Overwrite when <em>uid</em> of the item model matches</td>
</tr>
<tr>
<td><em>summary</em></td>
<td>string</td>
<td>Overwrite</td>
</tr>
<tr>
<td><em>description</em></td>
<td>string</td>
<td>Overwrite</td>
</tr>
</tbody>
</table>
<h4 id="rest-api-item-model">REST API item model</h4>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td><em>uid</em></td>
<td>string</td>
<td>Key</td>
</tr>
</tbody>
</table>
<h3 id="conceptual-model">Conceptual model</h3>
<table>
<thead>
<tr>
<th>Key</th>
<th>Type</th>
<th>Overwrite behavior</th>
</tr>
</thead>
<tbody>
<tr>
<td><em>title</em></td>
<td>string</td>
<td>Overwrite</td>
</tr>
<tr>
<td><em>rawTitle</em></td>
<td>string</td>
<td>Overwrite</td>
</tr>
<tr>
<td><em>conceptual</em></td>
<td>string</td>
<td>Overwrite</td>
</tr>
</tbody>
</table>
<div id="disqus_thread"></div>
                <script>
                (function() { // DON'T EDIT BELOW THIS LINE
                var d = document, s = d.createElement('script');
                s.src = 'https://docfx-github.disqus.com/embed.js';
                s.setAttribute('data-timestamp', +new Date());
                (d.head || d.body).appendChild(s);
                })();
                </script>
                <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
            </article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                  <li>
                    <a href="#disqus_thread" class="contribution-link">0 Comments</a>
                  </li>
                </ul>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
              <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            <span>Copyright © 2015-2018 Microsoft<br>Generated by <strong>DocFX</strong></span>
            
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../styles/docfx.js"></script>
    <script type="text/javascript" src="../styles/main.js"></script>
    <script id="dsq-count-scr" src="//docfx-github.disqus.com/count.js" async=""></script>
    
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
    
      ga('create', 'UA-99241001-1', 'auto');
      ga('send', 'pageview');
    
    </script>
  </body>
</html>
